{% load shorturl %}
<div class="facebook_share" id="facebook{{ item.id }}">
    <form class="facebook_form" id="facebook_form{{ item.id }}" method="POST"
          action="/item/facebook/post/{% if story %}story/{% endif %}">
    {% csrf_token %}
    {% with image=item.get_small_image %}
        {% if image %}
            <input type="hidden" name="photo" value="{{ image }}">
        {% endif %}
    {% endwith %}
    <input type="hidden" name="url" value="{% shorturl item %}">
    <input type="hidden" name="message" value="{{ item.message }}">
    <input type="hidden" name="item" value="{{ item.id }}">
    {% if profile_user %}
        <input type="hidden" name="profile" value="{{ profile_user.id }}">
    {% endif %}
    <div class="title">
        <img src="{{ STATIC_URL }}images/facebook.png">
        Post to profile
        <div class="facebook_close"></div>
    </div>
    <div class="facebook_message">
        <div class="avatar">
            {% if user.avatar %}
                <img class="avatar" src="{{ user.avatar.url }}">
            {% else %}
                <img class="avatar" src="{{ STATIC_URL }}/images/default.jpg">
            {% endif %}
        </div>
        <div class="facebook_content">
            <div>
                <textarea class="facebook_message" name="facebook_message"
                          placeholder="What's on your mind"></textarea>
            </div>
            <div class="item_message">
                <div class="item_image">
                    <a href="{{ item.get_absolute_url }}">
                        {% with image=item.get_small_image %}
                            {% if image %}
                                <img src="{{ image }}"/>
                            {% else %}
                                <img src="{{STATIC_URL}}images/blank.png"/>
                            {% endif %}
                        {% endwith %}
                    </a>
                </div>
                <div class="item_links">
                    <span class="strong">{{ item.message }}</span><br>
                    <span class="gray small">{% shorturl item %}</span>
                    <div class="facebook_submit">
                        <input type="submit" class="submit_button facebook_button" value="Post">
                    </div>
                </div>
            </div>
        </div>
    </div>
    </form>
</div>